package com.example.oneSpringMVC.mapper;


import com.example.oneSpringMVC.entity.Permission;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xinTong
 * @since 2024-01-24
 */
public interface PermissionMapper {

    /**
     * 查询全部数据
     * @return
     */
    @Select("select * from rbac.permission")
    List<Permission> listAll();

    /**
     * 分页查询数据
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Select("select * from rbac.permission")
    Page<Permission> list();

    /**
     * 总记录
     * @return
     */
    @Select("select count(*) from rbac.permission")
    int total();

    /**
     * 通过角色id获取相应的权限信息
     * @param roleId
     * @return
     */
    List<Permission> queryPermission(Long userId);
}
